package Year21_Month12.day1201;

public class Soultion {
    public void moveZeroes(int[] nums) {
        int pre = 0;
        int cur = 0;
        int size = nums.length;
        while(cur < size){
            if(nums[cur] != 0){
                swap(nums,cur,pre);
                pre++;
            }
            cur++;
        }
    }
    public void swap(int[] nums,int i,int j){
        int tmp = nums[i];
        nums[i] = nums[j];
        nums[j] = tmp;
    }
}
/*
public int maxArea(int[] height) {
        int left = 0;
        int right = height.length - 1;
        int maxWater = 0;
        while(left < right){
            int max = Math.min(height[left],height[right]) * (right - left);
            maxWater = max > maxWater ? max : maxWater;
            if(height[left] > height[right]){
                right--;
            }else{
                left++;
            }
        }
        return maxWater;
    }
 */
